package com.syg.Listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

/**
 * 监听session对象属性的添加,删除,修改
 */
public class _05_SessionAttribute_Listener implements HttpSessionAttributeListener {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

        @Override
    public void attributeAdded(HttpSessionBindingEvent httpSessionBindingEvent) {
        logger.info("attributeAdded()==>session对象添加属性了");
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent httpSessionBindingEvent) {
        logger.info("attributeRemoved()==>session对象移除属性了");
    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent httpSessionBindingEvent) {
        logger.info("attributeReplaced()==>session对象修改属性了");
    }
}
